<template>
    <div>
        <div style="padding: 10px;" v-for="(widget, wIndex) in viewModel" :key="wIndex">
            <component :is="widget.pcElement" :widget="widget" />
        </div>
    </div>
</template>

<script>
import request from '@/utils/request'
export default {
    data() {
        return {
            viewModel: [
                {
                    pcElement: 'x-input',
                    type: 'TextBoxControl',
                    data: {
                        name: '测试'
                    }
                },
                {
                    pcElement: 'el-switch',
                    type: 'TextBoxControl',
                    data: {
                        name: '测试'
                    }
                },
                {
                    pcElement: 'x-input',
                    type: 'TextAreaControl',
                    data: {
                        name: '测试'
                    }
                },
                {
                    pcElement: 'x-input',
                    type: 'NumbericControl',
                    data: {
                        name: '测试'
                    }
                },
                {
                    pcElement: 'x-input',
                    type: 'DecimalControl',
                    data: {
                        name: '测试'
                    }
                },
                {
                    pcElement: 'x-input',
                    type: 'PhoneControl',
                    data: {
                        name: '测试'
                    }
                },
                {
                    pcElement: 'x-input',
                    type: 'PassWordControl',
                    data: {
                        name: '测试'
                    }
                },
                {
                    pcElement: 'x-input',
                    type: 'PasswordNumberControl',
                    data: {
                        name: '测试'
                    }
                },
                {
                    pcElement: 'x-input',
                    type: 'RadioButtonControl',
                    data: {
                        name: '测试'
                    }
                },
                {
                    pcElement: 'x-input',
                    type: 'CheckBoxControl',
                    data: {
                        name: '测试'
                    }
                },
                {
                    pcElement: 'x-input',
                    type: 'PhoneVerifiyControl',
                    data: {
                        name: '测试'
                    }
                }
            ]
        }
    },
    mounted() {
        this.init()
    },
    methods: {
        async init() {
            var repones = await request({
                url: 'https://api.alaboshu.com/api/JavaFormEngine/test?id=64e68fe0f22281557d939e4f',
                method: 'get'
            })
            console.log('yyyyyyyyttttttttttt', JSON.parse(repones.result.play))
        }
    }
}
</script>

<style></style>